package datastructure.single;

/**
 * @Author ZhangCuirong
 * @Date 2025/7/30 8:20
 * @description: 双重校验锁-懒汉单例模式
 */
public class Single {
    public static volatile Single single = null;

    public Single getInstance() {
        if (single == null) {
            synchronized (Single.class) {
                if (single == null) {
                    single = new Single();
                }
            }
        }
        return single;
    }
}
